<!DOCTYPE html>
<html lang="zh">
<head>
    {{template "header" (ossUrl)}}
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-job-add">
        <input type="hidden" name="createBy" value="{{.createBy}}">
        <div class="form-group">
            <label class="col-sm-3 control-label">任务名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="jobName" id="jobName" required>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请输入纯英文字母</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">任务分组：</label>
            <div class="col-sm-8">
                {{getDictTypeSelect "sys_job_group" "jobGroup" "jobGroup" "" "" "" ""}}
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">执行方法名：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="invokeTarget" id="invokeTarget" required>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>方法名 示例：test1</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">执行参数：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="jobParams" id="jobParams" required>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>以|分隔多个参数 示例：param1|param1</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">cron表达式：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="cronExpression" id="cronExpression" required>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 0 30 * * * *：每30分钟执行一次</span>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> * * * * * *：每秒执行一次</span>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> @hourly：每小时执行一次</span>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> @every 1h30m：每1个半小时执行一次</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">执行策略：</label>
            <div class="col-sm-8">
                <label class="radio-box"> <input type="radio" name="misfirePolicy" value="1" checked="true"/> 重复执行 </label>
                <label class="radio-box"> <input type="radio" name="misfirePolicy" value="2"/> 执行一次 </label>
            </div>
        </div>
        <div class="form-group" style="display: none">
            <label class="col-sm-3 control-label">并发执行：</label>
            <div class="col-sm-8">
                <label class="radio-box"> <input type="radio" name="concurrent" value="0"/> 允许 </label>
                <label class="radio-box"> <input type="radio" name="concurrent" value="1" checked="true"/> 禁止 </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：<input type="hidden" id="status" name="status" value="1"/></label>
            <div class="col-sm-8">
                <textarea id="remark" name="remark" class="form-control"></textarea>
            </div>
        </div>
    </form>
</div>
{{template "footer" (ossUrl)}}
<script type="text/javascript">
    var prefix = ctx + "monitor/job";

    $("#form-job-add").validate({
        onkeyup: false,
        rules: {},
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-job-add').serialize());
        }
    }
</script>
</body>
</html>
